<template>
  <div class="app-container">

    <div class="search-container">
      <div class="search-title">
        查询条件
      </div>
      <div class="search-form">
        <div class="form-row">
          <div class="form-column">
            <span class="column-title">姓名</span>
            <el-input v-model="queryParams.keyword" placeholder="请输入" class="input-w150" clearable
              @keyup.enter.native="handleQuery" />
          </div>
          <div class="form-column">
            <el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
            <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
          </div>
        </div>
      </div>
    </div>


    <div class="body-container">
      <div class="operation-bar">
        <div class="bar-title">
          待审核人员列表
        </div>
      </div>

      <el-table v-loading="loading" stripe :data="dataList">
        <el-table-column type="index" label="#" align="center" min-width="100"></el-table-column>
        <el-table-column label="姓名" prop="updateTime" align="center" min-width="170" />
        <el-table-column label="申请时间" prop="materialDesc" align="center" min-width="120" show-overflow-tooltip />
        <el-table-column label="操作" align="center" min-width="120" class-name="small-padding fixed-width">
          <div class="table-option" slot-scope="scope" v-if="scope.row.roleId !== 1">
            <span>人员详情</span>
            <span>通过</span>
            <span class="danger">驳回</span>
          </div>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList" />
    </div>

  </div>
</template>

<script>
import { approvalUser } from "@/api/talent";
export default {
  name: "file",
  components: {
  },
  data () {
    return {
      dataList: [],
      loading: true,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  created () {
    this.getList();
  },
  methods: {

    // 查询
    async getList () {
      this.loading = true;
      this.queryParams.materialCategoryType = this.tabActive
      const res = await materialList(this.queryParams)
      this.loading = false;
      if (res.code === 200) {
        this.dataList = res.data || [];
        this.total = res.total || 0;
      } else {
        this.dataList = [];
        this.total = 0;
      }
    },
    // 查询
    handleQuery () {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    // 重置
    resetQuery () {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
      }
      this.handleQuery();
    }
  }
};
</script>
<style lang="scss" scoped>
.file-name {
  display: flex;
  align-items: center;
  justify-content: center;

  .img-icon {
    width: 20px;
    height: 20px;
  }

  span {
    margin-left: 8px;
  }
}
</style>